<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Insert title here</title>
	</head>
	<body>
	<a4j:form id="form">
		<a4j:keepAlive beanName="perguntaBean"></a4j:keepAlive>
		<h:messages id="mensagens" globalOnly="true"></h:messages>
		<a4j:status id="status">
			<f:facet name="start">
				<h:graphicImage value="themes/default/images/busy.gif" />
			</f:facet>
		</a4j:status>
	*Titulo:
	<h:inputText id="tfTitulo" value="#{perguntaBean.pergunta.titulo}"
			required="true" requiredMessage="Campo Obrigatório">
		</h:inputText>

		<br />
	*Descrição:
	<h:inputTextarea id="tfDescricao"
			value="#{perguntaBean.pergunta.descricao}" required="true"
			requiredMessage="Campo obrigatório">
		</h:inputTextarea>
		<br />
	Tags:
	<h:selectOneMenu id="tag" converter="genericConverter"
			value="#{perguntaBean.tag}" required="true"
			requiredMessage="Campo obrigatório">
			<f:selectItem itemLabel="Escolha" />
			<f:selectItems value="#{suportBean.tagSelect}" />
		</h:selectOneMenu>
		<a4j:commandButton action="#{perguntaBean.addTag}" reRender="form"
			value="Adicionar Tags" />
		<br />
	Tags:
	<rich:dataTable border="1" id="table"
		value="#{perguntaBean.pergunta.tags}" var="item" rows="10">
		<rich:column id="column1">
			<f:facet name="header">Nome</f:facet>
			<h:outputText id="nomeItem" value="#{item.nome}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">Excluir</f:facet>
			<a4j:commandLink value="Excluir">
			</a4j:commandLink>
		</rich:column>
	</rich:dataTable>
	<br />
	<a4j:commandButton id="btSalvar" value="salvar" type="submit"
		action="#{perguntaBean.save}" reRender="form">
	</a4j:commandButton>
	</a4j:form>
	</body>
</ui:composition>